load(key).

discretize(entropy).
use_package(hypspc).
minimal_cases(2).                      %  Número de ejemplos cubiertos por cada hoja como mínimo
accuracy(0.80).
random_test_set(0.1).

classes([setosa,versicolor,virginica]).
predict(class(+iris,-clss)).



% rmode(1:sepal_length(+Iris,#)).
rmode(1:sepal_length(+Iris,-Number)).

% rmode(1:sepal_width(+Iris,#)).
rmode(1:sepal_width(+Iris,-Number)).

% rmode(1:petal_length(+Iris,#)).
rmode(1:petal_length(+Iris,-Number)).

% rmode(1:petal_width(+Iris,#)).
rmode(1:petal_width(+Iris,-Number)).



typed_language(yes).
type(sepal_length(iris,number)).
type(sepal_width(iris,number)).
type(petal_length(iris,number)).
type(petal_width(iris,number)).

type(number =< number).
type(number >= number).
% type(number = number).


auto_lookahead(sepal_length(Iris,Number),[Number]).
auto_lookahead(sepal_width(Iris,Number),[Number]).
auto_lookahead(petal_length(Iris,Number),[Number]).
auto_lookahead(petal_width(Iris,Number),[Number]).





discretize(entropy).

discretization(bounds(5)).

to_be_discretized(sepal_length(Iris,Number),[Number]).
rmode(1: #(C:threshold(sepal_length(_, Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(sepal_length(_, Number), [Number], C),+Number =< C)).
% rmode(1: #(C:threshold(sepal_length(_, Number), [Number], C),+Number = C)).

to_be_discretized(sepal_width(Iris,Number),[Number]).
rmode(1: #(C:threshold(sepal_width(_, Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(sepal_width(_, Number), [Number], C),+Number =< C)).
% rmode(1: #(C:threshold(sepal_width(_, Number), [Number], C),+Number = C)).

to_be_discretized(petal_length(Iris,Number),[Number]).
rmode(1: #(C:threshold(petal_length(_, Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(petal_length(_, Number), [Number], C),+Number =< C)).
% rmode(1: #(C:threshold(petal_length(_, Number), [Number], C),+Number = C)).


to_be_discretized(petal_width(Iris,Number),[Number]).
rmode(1: #(C:threshold(petal_width(_, Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(petal_width(_, Number), [Number], C),+Number =< C)).
% rmode(1: #(C:threshold(petal_width(_, Number), [Number], C),+Number = C)).








